package adfc2.render3d.mesh;

import adfc2.Renderer3D;
import adfc2.render3d.IRenderable;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * Модель --- набор элементов
 */
public class Mesh implements IRenderable {
    public final List<IRenderable> parts;

    public Mesh(IRenderable... parts) {
        this.parts = Collections.unmodifiableList(
                Arrays.asList(parts)
        );
    }

    public Mesh(List<IRenderable> parts) {
        this.parts = Collections.unmodifiableList(parts);
    }

    public void render(Renderer3D renderer) {
        for (IRenderable part : parts) {
            part.render(renderer);
        }
    }
}
